//
//  XDLMInvestProcess.m
//  xindailianmeng
//
//  Created by xu on 17/3/19.
//  Copyright © 2017年 xindailianmeng.cn. All rights reserved.
//

#import "XDLMInvestProcess.h"

@interface XDLMInvestProcess ()

@property (nonatomic, strong)UIView         *dabangView;
@property (nonatomic, strong)UIView         *bgview;

@end

@implementation XDLMInvestProcess

-(instancetype)init{
    self = [super init];
    if (self) {
        [self buildLayout];
    }
    return self;
}

- (void)buildLayout{
    self.dabangView = [[UIView alloc]initWithFrame:CGRectMake(0, 64, kScreenW, kScreenH - 64)];
    self.dabangView.backgroundColor = [UIColor clearColor];
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapToHide)];
    [self.dabangView addGestureRecognizer:tap];
    
    self.bgview = [[UIView alloc]initWithFrame:CGRectMake(100, 100, 100, 100)];
    self.bgview.backgroundColor = [UIColor blackColor];
    
    for (int i = 0; i < 3; i ++) {
        UILabel *ll = [[UILabel alloc]initWithFrame:CGRectMake(0, i * 30, 100, 30)];
        ll.tag = i;
        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapToHidedd:)];
        [self.dabangView addGestureRecognizer:tap];
        ll.text = [NSString stringWithFormat:@"%d",i];
        [self.bgview addSubview:ll];
    }
}

- (void)tapToHide{
    [self.dabangView removeFromSuperview];
}

- (void)tapToHidedd:(UITapGestureRecognizer *)tap{
    UILabel *ll = (UILabel *)tap.view;
    if (self.ActionCilckToDate) {
        self.ActionCilckToDate(ll.tag);
    }
}

-(void)showProcess{
    [[UIApplication sharedApplication].keyWindow addSubview:self
     .dabangView];
}


-(void)hideProcess{
    [self.dabangView removeFromSuperview];
}

@end
